<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增供应商')" />


</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="goods-supplier-add">
			<div class="form-group">	
				<label class="col-sm-2 control-label is-required">供应商名称：</label>
				<div class="col-sm-10">
					<input id="supplierName" name="supplierName" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">供应商编码：</label>
				<div class="col-sm-10">
					<input id="supplierCode" name="supplierCode" class="form-control" type="text" required>
				</div>
			</div>

			<!-- 关联分类-->
			<div class="form-group">
				<label class="col-sm-2 control-label">供应商分类：</label>
				<div class="col-sm-10">
					<select name="supplierCategoryId" class="form-control m-b" >
						<option value=0>全部</option>
						<option th:each="category : ${categorys}" th:text="${category.supplierCategoryName}"
								th:value="${category.supplierCategoryId}"></option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">联系人：</label>
				<div class="col-sm-10">
					<input id="supplierContact" name="supplierContact" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">联系电话：</label>
				<div class="col-sm-10">
					<input id="supplierMobile" name="supplierMobile" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">座机号码：</label>
				<div class="col-sm-10">
					<input id="supplierLandline" name="supplierLandline" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">邮箱：</label>
				<div class="col-sm-10">
					<input id="supplierEmail" name="supplierEmail" class="form-control" type="text" required>
				</div>
			</div>

			<!-- 	省市区联动 TODO-->
			<!-- 	省市区联动 TODO-->
<!--			<div  class="form-group" id="element_id" data-url="cityData.min.json" data-selects="province,city,area"-->
<!--				  data-required="true"></div>-->

			<div id="element1" class="row">
				<div class="col-sm-2">
					<select class="province form-control m-b" data-first-title="选择省">
						<option value="">请选择</option>
						<option value="广东省" selected>广东省</option>
					</select>
				</div>
				<div class="col-sm-2">
					<select class="city form-control m-b" data-first-title="选择市">
						<option value="">请选择</option>
						<option value="深圳市" selected>深圳市</option>
					</select>
				</div>
				<div class="col-sm-2">
					<select class="area form-control m-b" data-first-title="选择地区">
						<option value="">请选择</option>
						<option value="南山区" selected>南山区</option>
					</select>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-2 control-label is-required">详细地址：</label>
				<div class="col-sm-10">
					<input id="supplierAddress" name="supplierAddress" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">银行账号：</label>
				<div class="col-sm-10">
					<input id="supplierBankAccount" name="supplierBankAccount" class="form-control" type="text" required>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-2 control-label is-required">开户银行：</label>
				<div class="col-sm-10">
					<input id="supplierBank" name="supplierBank" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">持卡人姓名：</label>
				<div class="col-sm-10">
					<input id="supplierCardholderName" name="supplierCardholderName" class="form-control" type="text" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label is-required">税务登记号：</label>
				<div class="col-sm-10">
					<input id="supplierTaxId" name="supplierTaxId" class="form-control" type="text" required>
				</div>
			</div>




			<div class="form-group">
				<label class="col-sm-2 control-label is-required">显示排序：</label>
				<div class="col-sm-10">
					<input class="form-control" type="text" name="orderNum" required>
				</div>
			</div>



		</form>
	</div>
    <th:block th:include="include :: footer" />
	<th:block th:include="include :: jquery-cxselect-js" />
    <script type="text/javascript">
        var prefix = ctx + "goods/supplier";

		var urlChina =  ctx + 'demo/form/cityData';
		$.cxSelect.defaults.url = urlChina;
		$('#element1').cxSelect({
			selects: ['province', 'city', 'area'],
			nodata: 'none'
		});


		$("#goods-supplier-add").validate({
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	// var sHTML = $('.summernote').summernote('code');
				// $("#noticeContent").val(sHTML);
				$.operate.save(prefix + "/add", $('#goods-supplier-add').serialize());
	        }
	    }
	</script>
</body>
</html>
